package com.dingreading.cloud.soms.service;

import com.dingreading.cloud.soms.dto.StoreProjectCycleDtoV2;
import com.dingreading.cloud.soms.dto.StoreProjectCycleDtoV3;
import com.dingreading.cloud.soms.entity.StoreProjectCycle;
import com.mybatisflex.core.service.IService;

import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2024-09-11
 */
public interface StoreProjectCycleService extends IService<StoreProjectCycle> {

    boolean haveNameV2(String storeUid, String uid, String projectUid, String name);

    boolean updateEnabledV2(String storeUid, String uid, Integer enabled, String staffUid, String staffName);

    int dropBeanV2(String storeUid, String uid);

    StoreProjectCycle getGtOrderNumV2(String storeUid, String projectUid, Integer orderNum);

    StoreProjectCycle getLtOrderNumV2(String storeUid, String projectUid, Integer orderNum);

    // 设置序号
    boolean updateOrderNum(String uid, Integer orderNum, String staffUid, String staffName);

    StoreProjectCycle getByUid(String uid);

    boolean updateInfo(
            String storeUid, String uid, String cycleName, Integer days, Integer lessons, Double totalAmount, Double unitAmount,
            String staffUid, String staffName
    );

    StoreProjectCycle getByCycleConfig(boolean selfStore, String storeUid, String uid);

    // 获取系统周期和门店自定义周期
    List<StoreProjectCycleDtoV2> listByCycleConfig(boolean selfStore, String storeUid, String projectUid);

    List<StoreProjectCycleDtoV3> configListByStoreUidAndProjectUidIn(boolean selfStore, String storeUid, List<String> projectUidList);

    int getMaxShowOrderV2(String storeUid, String projectUid);

    boolean setEnabled(
            String storeUid, String uid, String cycleName, Integer days, Integer lessons,
            Double totalAmount, Double unitAmount, String staffUid, String staffName
    );

    void dropByProjectUid(String storeUid, String projectUid);
}
